<?php
/* @var $this AnalysisController */
$emptyText = '<div class="no_meetgive ff_s"><span class="ico ico_tip"></span>还未创建“套餐优惠券”，现在去';
$emptyText .= CHtml::link(Yii::t('cmp','Create Coupon'),array('createCoupon'),array('class'=>'mem_btn mem_btn20'));
$emptyText .= '</div>';
?>

<table class="list_table list_table2" cellpadding="0" cellspacing="0" width="100%">
	<thead>
		<tr>
			<th width="22%" class="pl15">优惠金额</th>
			<th width="15%">有效期至</th>
			<th width="10%">剩余数量</th>
			<th width="10%">限领数量</th>
			<th width="14%">状态</th>
			<th width="16%">操作</th>                                                       
		</tr>
	</thead>
</table>

<?php   
$this->widget('zii.widgets.CListView', array(  
    'dataProvider'=>$model->search(),  
    'itemView'=>'_coupon_view',    
    'emptyText'=>$emptyText,  
    'batchItem'=>array(  
        //创建优惠券
        CHtml::link(Yii::t('cmp','Create Coupon').'<b class="mem_bgx left"></b><b class="mem_bgx right"></b>',array('createCoupon'),array('class'=>'mem_bgx link_btn')),  
    ),  
    ));  
?>  

<script src="<?php echo Yii::app()->baseUrl;?>/js/ZeroClipboard/ZeroClipboard.js"></script>    
<script type="text/javascript">  
$(function(){
    //设置ZeroClipboard.swf的路径    
    ZeroClipboard.setMoviePath("<?php echo Yii::app()->baseUrl;?>/js/ZeroClipboard/ZeroClipboard.swf");     
    $("a[id^=btnCopy_]").each(function(){    
        var clip = new ZeroClipboard.Client();      
        clip.setHandCursor(true);     
            
        var obj = $(this);    
        var id = $(this).attr("id");    
        var content = $(this).attr("copyContent");    
        clip.setText(content);      
        clip.glue(id);    
            
        //这个是复制成功后的提示      
        clip.addEventListener( "complete", function(){      
            art.dialog({  
                title: '复制优惠券领取地址',  
                okValue:'确认',  
                content:"已经复制到剪切板！<br>"+"\n"+content,  
                ok: function () {  
                    return true;  
                },  
              });   
        });     
    });    
});  
</script>  